using SqlSugar;
using IM.Easy.Core.Audit;

namespace IM.Easy.Entity.System
{
    /// <summary>
    /// 第三方平台账户基本信息
    /// </summary>
    [SugarTable("ExternalUserAccount")]
    public class ExternalUserAccount : ICreatedAt, IUpdatedAt, IDeletedAt
    {
        /// <summary>
        /// 主键ID
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主键KEY")]
        public int Id { get; set; }

        /// <summary>
        /// 系统内用户 ID
        /// </summary>
        [SugarColumn(ColumnName = "UserId")]
        public long? UserId { get; set; }

        /// <summary>
        /// 外部平台标识
        /// </summary>
        [SugarColumn(ColumnName = "Provider")]
        public string Provider { get; set; }

        /// <summary>
        /// 外部平台用户唯一 ID
        /// </summary>
        [SugarColumn(ColumnName = "ProviderUserId")]
        public string ProviderUserId { get; set; }

        /// <summary>
        /// 用户名
        /// </summary>
        [SugarColumn(ColumnName = "UserName")]
        public string? UserName { get; set; }

        /// <summary>
        /// 显示名
        /// </summary>
        [SugarColumn(ColumnName = "NickName")]
        public string? NickName { get; set; }

        /// <summary>
        /// 邮箱地址
        /// </summary>
        [SugarColumn(ColumnName = "Email")]
        public string? Email { get; set; }

        /// <summary>
        /// 头像 URL
        /// </summary>
        [SugarColumn(ColumnName = "AvatarUrl")]
        public string? AvatarUrl { get; set; }

        /// <summary>
        /// 授权范围
        /// </summary>
        [SugarColumn(ColumnName = "Scope")]
        public string? Scope { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [SugarColumn(ColumnName = "CreatedAt")]
        public DateTime? CreatedAt { get; set; }

        /// <summary>
        /// 更新时间
        /// </summary>
        [SugarColumn(ColumnName = "UpdatedAt")]
        public DateTime? UpdatedAt { get; set; }

        /// <summary>
        /// 是否已删除
        /// </summary>
        [SugarColumn(ColumnName = "IsDeleted")]
        public byte IsDeleted { get; set; }

        /// <summary>
        /// 删除人ID
        /// </summary>
        [SugarColumn(ColumnName = "DeletedBy")]
        public long DeletedBy { get; set; }

        /// <summary>
        /// 删除时间
        /// </summary>
        [SugarColumn(ColumnName = "DeletedAt")]
        public DateTime? DeletedAt { get; set; }


    }
}
